/*
 *  Copyright (C) 2010 Glauco
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.balisunrise.builder;

import org.balisunrise.annotation.util.FilterUtilities;
import org.balisunrise.common.EntityFilter;

/**
 * Esta Inteface é responsável pela construção dos filtros das entidades.
 *
 * @author Glauco
 *
 * @see org.balisunrise.annotation.Filter
 * @see org.balisunrise.annotation.util.FilterUtilities
 * @see org.balisunrise.annotation.FilterCriteria
 * @see org.balisunrise.common.FilterField
 * @see org.balisunrise.common.EntityFilter
 * @see org.balisunrise.common.EntityLoader
 */
public interface EntityFilterBuilder {

    /**
     * Cria os filtros da entidade a partir da classe da entidade e o alias 
     * para construção do filtro.
     * Este método cria os campos dos filtros (FilterField), porém não cria
     * o EntityLoader, o qual deve ser atribuido pelo busca.
     * 
     * @param entityClass Classe da entidade dos filtros.
     * @param alias Alias para construir o EntityFilter.
     * @return Um EntityFilter.
     * 
     * @see org.balisunrise.annotation.Filter
     * @see org.balisunrise.annotation.FilterCriteria
     * @see org.balisunrise.common.FilterField
     * @see org.balisunrise.common.EntityFilter
     * @see org.balisunrise.common.EntityLoader
     */
    public EntityFilter create(Class entityClass, String alias)
            throws BuilderException;

    /**
     * Cria os filtros da entidade a partir do FilterUtilities.
     * Este método cria os campos dos filtros (FilterField), porém não cria
     * o EntityLoader, o qual deve ser atribuido pelo busca.
     *
     * @param filterUtilities Utilitário para construção dos filtros.
     * @return Um EntityFilter.
     *
     * @see org.balisunrise.annotation.util.FilterUtilities
     * @see org.balisunrise.common.FilterField
     * @see org.balisunrise.common.EntityFilter
     * @see org.balisunrise.common.EntityLoader
     */
    public EntityFilter create(FilterUtilities filterUtilities)
            throws BuilderException;
}
